#include "trap.h"
#include "inst_test.h"
#include "asm/regdef.h"
#include "asm/asm.h"
    .set noreorder
    .set noat 
    .global main 
    .text 

main:

    ori $t0, $zero, 0x10        # $t0 = 16
    ori $t1, $zero, 0x20        # $t1 = 32
    lw $t2, 0($t0)              # Load word from address $t0
    sw $t1, 4($t0)              # Store word at address $t0 + 4
    lb $t3, 1($t0)              # Load byte from address $t0 + 1
    sb $t3, 2($t0)              # Store byte at address $t0 + 2
    addiu $t4, $t2, 0xFF        # $t4 = $t2 + 0xFF
    sll $t5, $t4, 2             # $t5 = $t4 << 2
    sllv $t6, $t5, $t1          # $t6 = $t5 << ($t1 & 31)
    andi $t7, $t6, 0xFFFF       # $t7 = $t6 & 0xFFFF

    HIT_GOOD_TRAP

inst_error:
    HIT_BAD_TRAP